;;; vimrc-mode.el --- vimrc editing commands for Emacs

;;; Copyright (C) 2011 Alpha Tan

;;
;; Author: Alpha Tan <alphatan.zh@gmail.com>
;; Time-stamp: <2011-05-04 14:34:23>
;; Version: 0.3.0   ;; `mv.ds.rev'
;;                  ;;      `mv': Main Version number
;;                  ;;      `ds': odd number: Developing version; 
;;                  ;;            even number: Stable version; 
;;                  ;;      `rev': REVision number
;; Keywords: vimrc .vim
;; Homepage: vimrc-mode.sf.net

;;; Version Control:
;; $Rev:: 4                                             $
;; $Author:: alphatan                                   $
;; $Date:: 2011-05-04 06:37:48 +0000 (Wed, 04 May 2011) $

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;; (load "vimrc-mode")
;; (add-to-list 'auto-mode-alist '(".vim\\(rc\\)?$" . vimrc-mode))
;;

;;; Code:

(require 'font-lock)

(defcustom vimrc-mode-hook nil
  "Normal hook run when entering vimrc-mode."
  :type 'hook
  :group 'data)

;; Regexps
(defconst vimrc-font-lock-keywords
  (eval-when-compile
    (list
     ;; Comment start:
     '("\\(^\\|[\t ]\\)\\(\".*\\)$"
       (2 font-lock-comment-face)) ;; Comment end;

     ;; String start:
     '("\\(\"[^\n\r\"]*\"\\)\\|\\('[^\n\r]*'\\)"
       (0 font-lock-string-face)) ;; String end;

     ;; Function-name start:
     '("^[ \t]*\\(fun[ction]*[!]\\)[ \t]*\\([a-z:A-Z0-9_]+\\)?"
       (1 font-lock-keyword-face)
       (2 font-lock-function-name-face nil t)) ;; Function-name end;
     '("\\(\\([a-zA-Z]*:\\)?[a-zA-Z]*\\)("
       (1 font-lock-function-name-face nil t)) ;; Function-name end;

     ;; Variables start:
     '("\\(\\([avg]:\\)\\|\\([&$]\\)\\)\\([a-zA-Z][a-zA-Z0-9_]*\\)"
       (0 font-lock-variable-name-face)
       ) ;; Variables end;

     ;; Variables.
     (list
      (concat "[^_]\\<\\("
                             "acd"
                       "\\|" "ai"
                       "\\|" "akm"
                       "\\|" "al"
                       "\\|" "aleph"
                       "\\|" "allowrevins"
                       "\\|" "altkeymap"
                       "\\|" "ambiwidth"
                       "\\|" "ambw"
                       "\\|" "anti"
                       "\\|" "antialias"
                       "\\|" "ar"
                       "\\|" "arab"
                       "\\|" "arabic"
                       "\\|" "arabicshape"
                       "\\|" "ari"
                       "\\|" "arshape"
                       "\\|" "autochdir"
                       "\\|" "autoindent"
                       "\\|" "autoread"
                       "\\|" "autowrite"
                       "\\|" "autowriteall"
                       "\\|" "aw"
                       "\\|" "awa"
                       "\\|" "background"
                       "\\|" "backspace"
                       "\\|" "backup"
                       "\\|" "backupcopy"
                       "\\|" "backupdir"
                       "\\|" "backupext"
                       "\\|" "backupskip"
                       "\\|" "balloondelay"
                       "\\|" "ballooneval"
                       "\\|" "balloonexpr"
                       "\\|" "bdir"
                       "\\|" "bdlay"
                       "\\|" "beval"
                       "\\|" "bex"
                       "\\|" "bexpr"
                       "\\|" "bg"
                       "\\|" "bh"
                       "\\|" "bin"
                       "\\|" "binary"
                       "\\|" "biosk"
                       "\\|" "bioskey"
                       "\\|" "bk"
                       "\\|" "bkc"
                       "\\|" "bl"
                       "\\|" "bomb"
                       "\\|" "breakat"
                       "\\|" "brk"
                       "\\|" "browsedir"
                       "\\|" "bs"
                       "\\|" "bsdir"
                       "\\|" "bsk"
                       "\\|" "bt"
                       "\\|" "bufhidden"
                       "\\|" "buflisted"
                       "\\|" "buftype"
                       "\\|" "casemap"
                       "\\|" "cb"
                       "\\|" "cc"
                       "\\|" "ccv"
                       "\\|" "cd"
                       "\\|" "cdpath"
                       "\\|" "cedit"
                       "\\|" "cf"
                       "\\|" "cfu"
                       "\\|" "ch"
                       "\\|" "charconvert"
                       "\\|" "ci"
                       "\\|" "cin"
                       "\\|" "cindent"
                       "\\|" "cink"
                       "\\|" "cinkeys"
                       "\\|" "cino"
                       "\\|" "cinoptions"
                       "\\|" "cinw"
                       "\\|" "cinwords"
                       "\\|" "clipboard"
                       "\\|" "cmdheight"
                       "\\|" "cmdwinheight"
                       "\\|" "cmp"
                       "\\|" "cms"
                       "\\|" "co"
                       "\\|" "cocu"
                       "\\|" "cole"
                       "\\|" "colorcolumn"
                       "\\|" "columns"
                       "\\|" "com"
                       "\\|" "comments"
                       "\\|" "commentstring"
                       "\\|" "compatible"
                       "\\|" "complete"
                       "\\|" "completefunc"
                       "\\|" "completeopt"
                       "\\|" "concealcursor"
                       "\\|" "conceallevel"
                       "\\|" "confirm"
                       "\\|" "consk"
                       "\\|" "conskey"
                       "\\|" "copyindent"
                       "\\|" "cot"
                       "\\|" "cp"
                       "\\|" "cpo"
                       "\\|" "cpoptions"
                       "\\|" "cpt"
                       "\\|" "crb"
                       "\\|" "cryptmethod"
                       "\\|" "cscopepathcomp"
                       "\\|" "cscopeprg"
                       "\\|" "cscopequickfix"
                       "\\|" "cscopetag"
                       "\\|" "cscopetagorder"
                       "\\|" "cscopeverbose"
                       "\\|" "cspc"
                       "\\|" "csprg"
                       "\\|" "csqf"
                       "\\|" "cst"
                       "\\|" "csto"
                       "\\|" "csverb"
                       "\\|" "cuc"
                       "\\|" "cul"
                       "\\|" "cursorbind"
                       "\\|" "cursorcolumn"
                       "\\|" "cursorline"
                       "\\|" "cwh"
                       "\\|" "debug"
                       "\\|" "deco"
                       "\\|" "def"
                       "\\|" "define"
                       "\\|" "delcombine"
                       "\\|" "dex"
                       "\\|" "dg"
                       "\\|" "dict"
                       "\\|" "dictionary"
                       "\\|" "diff"
                       "\\|" "diffexpr"
                       "\\|" "diffopt"
                       "\\|" "digraph"
                       "\\|" "dip"
                       "\\|" "dir"
                       "\\|" "directory"
                       "\\|" "display"
                       "\\|" "dy"
                       "\\|" "ea"
                       "\\|" "ead"
                       "\\|" "eadirection"
                       "\\|" "eb"
                       "\\|" "ed"
                       "\\|" "edcompatible"
                       "\\|" "ef"
                       "\\|" "efm"
                       "\\|" "ei"
                       "\\|" "ek"
                       "\\|" "enc"
                       "\\|" "encoding"
                       "\\|" "endofline"
                       "\\|" "eol"
                       "\\|" "ep"
                       "\\|" "equalalways"
                       "\\|" "equalprg"
                       "\\|" "errorbells"
                       "\\|" "errorfile"
                       "\\|" "errorformat"
                       "\\|" "esckeys"
                       "\\|" "et"
                       "\\|" "eventignore"
                       "\\|" "ex"
                       "\\|" "expandtab"
                       "\\|" "exrc"
                       "\\|" "fcl"
                       "\\|" "fcs"
                       "\\|" "fdc"
                       "\\|" "fde"
                       "\\|" "fdi"
                       "\\|" "fdl"
                       "\\|" "fdls"
                       "\\|" "fdm"
                       "\\|" "fdn"
                       "\\|" "fdo"
                       "\\|" "fdt"
                       "\\|" "fen"
                       "\\|" "fenc"
                       "\\|" "fencs"
                       "\\|" "fex"
                       "\\|" "ff"
                       "\\|" "ffs"
                       "\\|" "fileencoding"
                       "\\|" "fileencodings"
                       "\\|" "fileformat"
                       "\\|" "fileformats"
                       "\\|" "filetype"
                       "\\|" "fillchars"
                       "\\|" "fk"
                       "\\|" "fkmap"
                       "\\|" "flp"
                       "\\|" "fml"
                       "\\|" "fmr"
                       "\\|" "fo"
                       "\\|" "foldclose"
                       "\\|" "foldcolumn"
                       "\\|" "foldenable"
                       "\\|" "foldexpr"
                       "\\|" "foldignore"
                       "\\|" "foldlevel"
                       "\\|" "foldlevelstart"
                       "\\|" "foldmarker"
                       "\\|" "foldmethod"
                       "\\|" "foldminlines"
                       "\\|" "foldnestmax"
                       "\\|" "foldopen"
                       "\\|" "foldtext"
                       "\\|" "formatexpr"
                       "\\|" "formatlistpat"
                       "\\|" "formatoptions"
                       "\\|" "formatprg"
                       "\\|" "fp"
                       "\\|" "fs"
                       "\\|" "fsync"
                       "\\|" "ft"
                       "\\|" "gcr"
                       "\\|" "gd"
                       "\\|" "gdefault"
                       "\\|" "gfm"
                       "\\|" "gfn"
                       "\\|" "gfs"
                       "\\|" "gfw"
                       "\\|" "ghr"
                       "\\|" "go"
                       "\\|" "gp"
                       "\\|" "grepformat"
                       "\\|" "grepprg"
                       "\\|" "gtl"
                       "\\|" "gtt"
                       "\\|" "guicursor"
                       "\\|" "guifont"
                       "\\|" "guifontset"
                       "\\|" "guifontwide"
                       "\\|" "guiheadroom"
                       "\\|" "guioptions"
                       "\\|" "guipty"
                       "\\|" "guitablabel"
                       "\\|" "guitabtooltip"
                       "\\|" "helpfile"
                       "\\|" "helpheight"
                       "\\|" "helplang"
                       "\\|" "hf"
                       "\\|" "hh"
                       "\\|" "hi"
                       "\\|" "hid"
                       "\\|" "hidden"
                       "\\|" "highlight"
                       "\\|" "history"
                       "\\|" "hk"
                       "\\|" "hkmap"
                       "\\|" "hkmapp"
                       "\\|" "hkp"
                       "\\|" "hl"
                       "\\|" "hlg"
                       "\\|" "hls"
                       "\\|" "hlsearch"
                       "\\|" "ic"
                       "\\|" "icon"
                       "\\|" "iconstring"
                       "\\|" "ignorecase"
                       "\\|" "im"
                       "\\|" "imactivatekey"
                       "\\|" "imak"
                       "\\|" "imc"
                       "\\|" "imcmdline"
                       "\\|" "imd"
                       "\\|" "imdisable"
                       "\\|" "imi"
                       "\\|" "iminsert"
                       "\\|" "ims"
                       "\\|" "imsearch"
                       "\\|" "inc"
                       "\\|" "include"
                       "\\|" "includeexpr"
                       "\\|" "incsearch"
                       "\\|" "inde"
                       "\\|" "indentexpr"
                       "\\|" "indentkeys"
                       "\\|" "indk"
                       "\\|" "inex"
                       "\\|" "inf"
                       "\\|" "infercase"
                       "\\|" "insertmode"
                       "\\|" "invacd"
                       "\\|" "invai"
                       "\\|" "invakm"
                       "\\|" "invallowrevins"
                       "\\|" "invaltkeymap"
                       "\\|" "invanti"
                       "\\|" "invantialias"
                       "\\|" "invar"
                       "\\|" "invarab"
                       "\\|" "invarabic"
                       "\\|" "invarabicshape"
                       "\\|" "invari"
                       "\\|" "invarshape"
                       "\\|" "invautochdir"
                       "\\|" "invautoindent"
                       "\\|" "invautoread"
                       "\\|" "invautowrite"
                       "\\|" "invautowriteall"
                       "\\|" "invaw"
                       "\\|" "invawa"
                       "\\|" "invbackup"
                       "\\|" "invballooneval"
                       "\\|" "invbeval"
                       "\\|" "invbin"
                       "\\|" "invbinary"
                       "\\|" "invbiosk"
                       "\\|" "invbioskey"
                       "\\|" "invbk"
                       "\\|" "invbl"
                       "\\|" "invbomb"
                       "\\|" "invbuflisted"
                       "\\|" "invcf"
                       "\\|" "invci"
                       "\\|" "invcin"
                       "\\|" "invcindent"
                       "\\|" "invcompatible"
                       "\\|" "invconfirm"
                       "\\|" "invconsk"
                       "\\|" "invconskey"
                       "\\|" "invcopyindent"
                       "\\|" "invcp"
                       "\\|" "invcrb"
                       "\\|" "invcscopetag"
                       "\\|" "invcscopeverbose"
                       "\\|" "invcst"
                       "\\|" "invcsverb"
                       "\\|" "invcuc"
                       "\\|" "invcul"
                       "\\|" "invcursorbind"
                       "\\|" "invcursorcolumn"
                       "\\|" "invcursorline"
                       "\\|" "invdeco"
                       "\\|" "invdelcombine"
                       "\\|" "invdg"
                       "\\|" "invdiff"
                       "\\|" "invdigraph"
                       "\\|" "invea"
                       "\\|" "inveb"
                       "\\|" "inved"
                       "\\|" "invedcompatible"
                       "\\|" "invek"
                       "\\|" "invendofline"
                       "\\|" "inveol"
                       "\\|" "invequalalways"
                       "\\|" "inverrorbells"
                       "\\|" "invesckeys"
                       "\\|" "invet"
                       "\\|" "invex"
                       "\\|" "invexpandtab"
                       "\\|" "invexrc"
                       "\\|" "invfen"
                       "\\|" "invfk"
                       "\\|" "invfkmap"
                       "\\|" "invfoldenable"
                       "\\|" "invgd"
                       "\\|" "invgdefault"
                       "\\|" "invguipty"
                       "\\|" "invhid"
                       "\\|" "invhidden"
                       "\\|" "invhk"
                       "\\|" "invhkmap"
                       "\\|" "invhkmapp"
                       "\\|" "invhkp"
                       "\\|" "invhls"
                       "\\|" "invhlsearch"
                       "\\|" "invic"
                       "\\|" "invicon"
                       "\\|" "invignorecase"
                       "\\|" "invim"
                       "\\|" "invimc"
                       "\\|" "invimcmdline"
                       "\\|" "invimd"
                       "\\|" "invimdisable"
                       "\\|" "invincsearch"
                       "\\|" "invinf"
                       "\\|" "invinfercase"
                       "\\|" "invinsertmode"
                       "\\|" "invis"
                       "\\|" "invjoinspaces"
                       "\\|" "invjs"
                       "\\|" "invlazyredraw"
                       "\\|" "invlbr"
                       "\\|" "invlinebreak"
                       "\\|" "invlisp"
                       "\\|" "invlist"
                       "\\|" "invloadplugins"
                       "\\|" "invlpl"
                       "\\|" "invlz"
                       "\\|" "invma"
                       "\\|" "invmacatsui"
                       "\\|" "invmagic"
                       "\\|" "invmh"
                       "\\|" "invml"
                       "\\|" "invmod"
                       "\\|" "invmodeline"
                       "\\|" "invmodifiable"
                       "\\|" "invmodified"
                       "\\|" "invmore"
                       "\\|" "invmousef"
                       "\\|" "invmousefocus"
                       "\\|" "invmousehide"
                       "\\|" "invnu"
                       "\\|" "invnumber"
                       "\\|" "invodev"
                       "\\|" "invopendevice"
                       "\\|" "invpaste"
                       "\\|" "invpi"
                       "\\|" "invpreserveindent"
                       "\\|" "invpreviewwindow"
                       "\\|" "invprompt"
                       "\\|" "invpvw"
                       "\\|" "invreadonly"
                       "\\|" "invrelativenumber"
                       "\\|" "invremap"
                       "\\|" "invrestorescreen"
                       "\\|" "invrevins"
                       "\\|" "invri"
                       "\\|" "invrightleft"
                       "\\|" "invrl"
                       "\\|" "invrnu"
                       "\\|" "invro"
                       "\\|" "invrs"
                       "\\|" "invru"
                       "\\|" "invruler"
                       "\\|" "invsb"
                       "\\|" "invsc"
                       "\\|" "invscb"
                       "\\|" "invscrollbind"
                       "\\|" "invscs"
                       "\\|" "invsecure"
                       "\\|" "invsft"
                       "\\|" "invshellslash"
                       "\\|" "invshelltemp"
                       "\\|" "invshiftround"
                       "\\|" "invshortname"
                       "\\|" "invshowcmd"
                       "\\|" "invshowfulltag"
                       "\\|" "invshowmatch"
                       "\\|" "invshowmode"
                       "\\|" "invsi"
                       "\\|" "invsm"
                       "\\|" "invsmartcase"
                       "\\|" "invsmartindent"
                       "\\|" "invsmarttab"
                       "\\|" "invsmd"
                       "\\|" "invsn"
                       "\\|" "invsol"
                       "\\|" "invspell"
                       "\\|" "invsplitbelow"
                       "\\|" "invsplitright"
                       "\\|" "invspr"
                       "\\|" "invsr"
                       "\\|" "invssl"
                       "\\|" "invsta"
                       "\\|" "invstartofline"
                       "\\|" "invstmp"
                       "\\|" "invswapfile"
                       "\\|" "invswf"
                       "\\|" "invta"
                       "\\|" "invtagbsearch"
                       "\\|" "invtagrelative"
                       "\\|" "invtagstack"
                       "\\|" "invtbi"
                       "\\|" "invtbidi"
                       "\\|" "invtbs"
                       "\\|" "invtermbidi"
                       "\\|" "invterse"
                       "\\|" "invtextauto"
                       "\\|" "invtextmode"
                       "\\|" "invtf"
                       "\\|" "invtgst"
                       "\\|" "invtildeop"
                       "\\|" "invtimeout"
                       "\\|" "invtitle"
                       "\\|" "invto"
                       "\\|" "invtop"
                       "\\|" "invtr"
                       "\\|" "invttimeout"
                       "\\|" "invttybuiltin"
                       "\\|" "invttyfast"
                       "\\|" "invtx"
                       "\\|" "invvb"
                       "\\|" "invvisualbell"
                       "\\|" "invwa"
                       "\\|" "invwarn"
                       "\\|" "invwb"
                       "\\|" "invweirdinvert"
                       "\\|" "invwfh"
                       "\\|" "invwfw"
                       "\\|" "invwildmenu"
                       "\\|" "invwinfixheight"
                       "\\|" "invwinfixwidth"
                       "\\|" "invwiv"
                       "\\|" "invwmnu"
                       "\\|" "invwrap"
                       "\\|" "invwrapscan"
                       "\\|" "invwrite"
                       "\\|" "invwriteany"
                       "\\|" "invwritebackup"
                       "\\|" "invws"
                       "\\|" "is"
                       "\\|" "isf"
                       "\\|" "isfname"
                       "\\|" "isi"
                       "\\|" "isident"
                       "\\|" "isk"
                       "\\|" "iskeyword"
                       "\\|" "isp"
                       "\\|" "isprint"
                       "\\|" "joinspaces"
                       "\\|" "js"
                       "\\|" "key"
                       "\\|" "keymap"
                       "\\|" "keymodel"
                       "\\|" "keywordprg"
                       "\\|" "km"
                       "\\|" "kmp"
                       "\\|" "kp"
                       "\\|" "langmap"
                       "\\|" "langmenu"
                       "\\|" "laststatus"
                       "\\|" "lazyredraw"
                       "\\|" "lbr"
                       "\\|" "lcs"
                       "\\|" "linebreak"
                       "\\|" "lines"
                       "\\|" "linespace"
                       "\\|" "lisp"
                       "\\|" "lispwords"
                       "\\|" "list"
                       "\\|" "listchars"
                       "\\|" "lm"
                       "\\|" "lmap"
                       "\\|" "loadplugins"
                       "\\|" "lpl"
                       "\\|" "ls"
                       "\\|" "lsp"
                       "\\|" "lw"
                       "\\|" "lz"
                       "\\|" "ma"
                       "\\|" "macatsui"
                       "\\|" "magic"
                       "\\|" "makeef"
                       "\\|" "makeprg"
                       "\\|" "mat"
                       "\\|" "matchpairs"
                       "\\|" "matchtime"
                       "\\|" "maxcombine"
                       "\\|" "maxfuncdepth"
                       "\\|" "maxmapdepth"
                       "\\|" "maxmem"
                       "\\|" "maxmempattern"
                       "\\|" "maxmemtot"
                       "\\|" "mco"
                       "\\|" "mef"
                       "\\|" "menuitems"
                       "\\|" "mfd"
                       "\\|" "mh"
                       "\\|" "mis"
                       "\\|" "mkspellmem"
                       "\\|" "ml"
                       "\\|" "mls"
                       "\\|" "mm"
                       "\\|" "mmd"
                       "\\|" "mmp"
                       "\\|" "mmt"
                       "\\|" "mod"
                       "\\|" "modeline"
                       "\\|" "modelines"
                       "\\|" "modifiable"
                       "\\|" "modified"
                       "\\|" "more"
                       "\\|" "mouse"
                       "\\|" "mousef"
                       "\\|" "mousefocus"
                       "\\|" "mousehide"
                       "\\|" "mousem"
                       "\\|" "mousemodel"
                       "\\|" "mouses"
                       "\\|" "mouseshape"
                       "\\|" "mouset"
                       "\\|" "mousetime"
                       "\\|" "mp"
                       "\\|" "mps"
                       "\\|" "msm"
                       "\\|" "mzq"
                       "\\|" "mzquantum"
                       "\\|" "nf"
                       "\\|" "noacd"
                       "\\|" "noai"
                       "\\|" "noakm"
                       "\\|" "noallowrevins"
                       "\\|" "noaltkeymap"
                       "\\|" "noanti"
                       "\\|" "noantialias"
                       "\\|" "noar"
                       "\\|" "noarab"
                       "\\|" "noarabic"
                       "\\|" "noarabicshape"
                       "\\|" "noari"
                       "\\|" "noarshape"
                       "\\|" "noautochdir"
                       "\\|" "noautoindent"
                       "\\|" "noautoread"
                       "\\|" "noautowrite"
                       "\\|" "noautowriteall"
                       "\\|" "noaw"
                       "\\|" "noawa"
                       "\\|" "nobackup"
                       "\\|" "noballooneval"
                       "\\|" "nobeval"
                       "\\|" "nobin"
                       "\\|" "nobinary"
                       "\\|" "nobiosk"
                       "\\|" "nobioskey"
                       "\\|" "nobk"
                       "\\|" "nobl"
                       "\\|" "nobomb"
                       "\\|" "nobuflisted"
                       "\\|" "nocf"
                       "\\|" "noci"
                       "\\|" "nocin"
                       "\\|" "nocindent"
                       "\\|" "nocompatible"
                       "\\|" "noconfirm"
                       "\\|" "noconsk"
                       "\\|" "noconskey"
                       "\\|" "nocopyindent"
                       "\\|" "nocp"
                       "\\|" "nocrb"
                       "\\|" "nocscopetag"
                       "\\|" "nocscopeverbose"
                       "\\|" "nocst"
                       "\\|" "nocsverb"
                       "\\|" "nocuc"
                       "\\|" "nocul"
                       "\\|" "nocursorbind"
                       "\\|" "nocursorcolumn"
                       "\\|" "nocursorline"
                       "\\|" "nodeco"
                       "\\|" "nodelcombine"
                       "\\|" "nodg"
                       "\\|" "nodiff"
                       "\\|" "nodigraph"
                       "\\|" "noea"
                       "\\|" "noeb"
                       "\\|" "noed"
                       "\\|" "noedcompatible"
                       "\\|" "noek"
                       "\\|" "noendofline"
                       "\\|" "noeol"
                       "\\|" "noequalalways"
                       "\\|" "noerrorbells"
                       "\\|" "noesckeys"
                       "\\|" "noet"
                       "\\|" "noex"
                       "\\|" "noexpandtab"
                       "\\|" "noexrc"
                       "\\|" "nofen"
                       "\\|" "nofk"
                       "\\|" "nofkmap"
                       "\\|" "nofoldenable"
                       "\\|" "nogd"
                       "\\|" "nogdefault"
                       "\\|" "noguipty"
                       "\\|" "nohid"
                       "\\|" "nohidden"
                       "\\|" "nohk"
                       "\\|" "nohkmap"
                       "\\|" "nohkmapp"
                       "\\|" "nohkp"
                       "\\|" "nohls"
                       "\\|" "nohlsearch"
                       "\\|" "noic"
                       "\\|" "noicon"
                       "\\|" "noignorecase"
                       "\\|" "noim"
                       "\\|" "noimc"
                       "\\|" "noimcmdline"
                       "\\|" "noimd"
                       "\\|" "noimdisable"
                       "\\|" "noincsearch"
                       "\\|" "noinf"
                       "\\|" "noinfercase"
                       "\\|" "noinsertmode"
                       "\\|" "nois"
                       "\\|" "nojoinspaces"
                       "\\|" "nojs"
                       "\\|" "nolazyredraw"
                       "\\|" "nolbr"
                       "\\|" "nolinebreak"
                       "\\|" "nolisp"
                       "\\|" "nolist"
                       "\\|" "noloadplugins"
                       "\\|" "nolpl"
                       "\\|" "nolz"
                       "\\|" "noma"
                       "\\|" "nomacatsui"
                       "\\|" "nomagic"
                       "\\|" "nomh"
                       "\\|" "noml"
                       "\\|" "nomod"
                       "\\|" "nomodeline"
                       "\\|" "nomodifiable"
                       "\\|" "nomodified"
                       "\\|" "nomore"
                       "\\|" "nomousef"
                       "\\|" "nomousefocus"
                       "\\|" "nomousehide"
                       "\\|" "nonu"
                       "\\|" "nonumber"
                       "\\|" "noodev"
                       "\\|" "noopendevice"
                       "\\|" "nopaste"
                       "\\|" "nopi"
                       "\\|" "nopreserveindent"
                       "\\|" "nopreviewwindow"
                       "\\|" "noprompt"
                       "\\|" "nopvw"
                       "\\|" "noreadonly"
                       "\\|" "norelativenumber"
                       "\\|" "noremap"
                       "\\|" "norestorescreen"
                       "\\|" "norevins"
                       "\\|" "nori"
                       "\\|" "norightleft"
                       "\\|" "norl"
                       "\\|" "nornu"
                       "\\|" "noro"
                       "\\|" "nors"
                       "\\|" "noru"
                       "\\|" "noruler"
                       "\\|" "nosb"
                       "\\|" "nosc"
                       "\\|" "noscb"
                       "\\|" "noscrollbind"
                       "\\|" "noscs"
                       "\\|" "nosecure"
                       "\\|" "nosft"
                       "\\|" "noshellslash"
                       "\\|" "noshelltemp"
                       "\\|" "noshiftround"
                       "\\|" "noshortname"
                       "\\|" "noshowcmd"
                       "\\|" "noshowfulltag"
                       "\\|" "noshowmatch"
                       "\\|" "noshowmode"
                       "\\|" "nosi"
                       "\\|" "nosm"
                       "\\|" "nosmartcase"
                       "\\|" "nosmartindent"
                       "\\|" "nosmarttab"
                       "\\|" "nosmd"
                       "\\|" "nosn"
                       "\\|" "nosol"
                       "\\|" "nospell"
                       "\\|" "nosplitbelow"
                       "\\|" "nosplitright"
                       "\\|" "nospr"
                       "\\|" "nosr"
                       "\\|" "nossl"
                       "\\|" "nosta"
                       "\\|" "nostartofline"
                       "\\|" "nostmp"
                       "\\|" "noswapfile"
                       "\\|" "noswf"
                       "\\|" "nota"
                       "\\|" "notagbsearch"
                       "\\|" "notagrelative"
                       "\\|" "notagstack"
                       "\\|" "notbi"
                       "\\|" "notbidi"
                       "\\|" "notbs"
                       "\\|" "notermbidi"
                       "\\|" "noterse"
                       "\\|" "notextauto"
                       "\\|" "notextmode"
                       "\\|" "notf"
                       "\\|" "notgst"
                       "\\|" "notildeop"
                       "\\|" "notimeout"
                       "\\|" "notitle"
                       "\\|" "noto"
                       "\\|" "notop"
                       "\\|" "notr"
                       "\\|" "nottimeout"
                       "\\|" "nottybuiltin"
                       "\\|" "nottyfast"
                       "\\|" "notx"
                       "\\|" "novb"
                       "\\|" "novisualbell"
                       "\\|" "nowa"
                       "\\|" "nowarn"
                       "\\|" "nowb"
                       "\\|" "noweirdinvert"
                       "\\|" "nowfh"
                       "\\|" "nowfw"
                       "\\|" "nowildmenu"
                       "\\|" "nowinfixheight"
                       "\\|" "nowinfixwidth"
                       "\\|" "nowiv"
                       "\\|" "nowmnu"
                       "\\|" "nowrap"
                       "\\|" "nowrapscan"
                       "\\|" "nowrite"
                       "\\|" "nowriteany"
                       "\\|" "nowritebackup"
                       "\\|" "nows"
                       "\\|" "nrformats"
                       "\\|" "nu"
                       "\\|" "number"
                       "\\|" "numberwidth"
                       "\\|" "nuw"
                       "\\|" "odev"
                       "\\|" "oft"
                       "\\|" "ofu"
                       "\\|" "omnifunc"
                       "\\|" "opendevice"
                       "\\|" "operatorfunc"
                       "\\|" "opfunc"
                       "\\|" "osfiletype"
                       "\\|" "pa"
                       "\\|" "para"
                       "\\|" "paragraphs"
                       "\\|" "paste"
                       "\\|" "pastetoggle"
                       "\\|" "patchexpr"
                       "\\|" "patchmode"
                       "\\|" "path"
                       "\\|" "pdev"
                       "\\|" "penc"
                       "\\|" "pex"
                       "\\|" "pexpr"
                       "\\|" "pfn"
                       "\\|" "ph"
                       "\\|" "pheader"
                       "\\|" "pi"
                       "\\|" "pm"
                       "\\|" "pmbcs"
                       "\\|" "pmbfn"
                       "\\|" "popt"
                       "\\|" "preserveindent"
                       "\\|" "previewheight"
                       "\\|" "previewwindow"
                       "\\|" "printdevice"
                       "\\|" "printencoding"
                       "\\|" "printexpr"
                       "\\|" "printfont"
                       "\\|" "printheader"
                       "\\|" "printmbcharset"
                       "\\|" "printmbfont"
                       "\\|" "printoptions"
                       "\\|" "prompt"
                       "\\|" "pt"
                       "\\|" "pumheight"
                       "\\|" "pvh"
                       "\\|" "pvw"
                       "\\|" "qe"
                       "\\|" "quoteescape"
                       "\\|" "rdt"
                       "\\|" "readonly"
                       "\\|" "redrawtime"
                       "\\|" "relativenumber"
                       "\\|" "remap"
                       "\\|" "report"
                       "\\|" "restorescreen"
                       "\\|" "revins"
                       "\\|" "ri"
                       "\\|" "rightleft"
                       "\\|" "rightleftcmd"
                       "\\|" "rl"
                       "\\|" "rlc"
                       "\\|" "rnu"
                       "\\|" "ro"
                       "\\|" "rs"
                       "\\|" "rtp"
                       "\\|" "ru"
                       "\\|" "ruf"
                       "\\|" "ruler"
                       "\\|" "rulerformat"
                       "\\|" "runtimepath"
                       "\\|" "sb"
                       "\\|" "sbo"
                       "\\|" "sbr"
                       "\\|" "sc"
                       "\\|" "scb"
                       "\\|" "scr"
                       "\\|" "scroll"
                       "\\|" "scrollbind"
                       "\\|" "scrolljump"
                       "\\|" "scrolloff"
                       "\\|" "scrollopt"
                       "\\|" "scs"
                       "\\|" "sect"
                       "\\|" "sections"
                       "\\|" "secure"
                       "\\|" "sel"
                       "\\|" "selection"
                       "\\|" "selectmode"
                       "\\|" "sessionoptions"
                       "\\|" "sft"
                       "\\|" "sh"
                       "\\|" "shcf"
                       "\\|" "shell"
                       "\\|" "shellcmdflag"
                       "\\|" "shellpipe"
                       "\\|" "shellquote"
                       "\\|" "shellredir"
                       "\\|" "shellslash"
                       "\\|" "shelltemp"
                       "\\|" "shelltype"
                       "\\|" "shellxquote"
                       "\\|" "shiftround"
                       "\\|" "shiftwidth"
                       "\\|" "shm"
                       "\\|" "shortmess"
                       "\\|" "shortname"
                       "\\|" "showbreak"
                       "\\|" "showcmd"
                       "\\|" "showfulltag"
                       "\\|" "showmatch"
                       "\\|" "showmode"
                       "\\|" "showtabline"
                       "\\|" "shq"
                       "\\|" "si"
                       "\\|" "sidescroll"
                       "\\|" "sidescrolloff"
                       "\\|" "siso"
                       "\\|" "sj"
                       "\\|" "slm"
                       "\\|" "sm"
                       "\\|" "smartcase"
                       "\\|" "smartindent"
                       "\\|" "smarttab"
                       "\\|" "smc"
                       "\\|" "smd"
                       "\\|" "sn"
                       "\\|" "so"
                       "\\|" "softtabstop"
                       "\\|" "sol"
                       "\\|" "sp"
                       "\\|" "spc"
                       "\\|" "spell"
                       "\\|" "spellcapcheck"
                       "\\|" "spellfile"
                       "\\|" "spelllang"
                       "\\|" "spellsuggest"
                       "\\|" "spf"
                       "\\|" "spl"
                       "\\|" "splitbelow"
                       "\\|" "splitright"
                       "\\|" "spr"
                       "\\|" "sps"
                       "\\|" "sr"
                       "\\|" "srr"
                       "\\|" "ss"
                       "\\|" "ssl"
                       "\\|" "ssop"
                       "\\|" "st"
                       "\\|" "sta"
                       "\\|" "stal"
                       "\\|" "startofline"
                       "\\|" "statusline"
                       "\\|" "stl"
                       "\\|" "stmp"
                       "\\|" "sts"
                       "\\|" "su"
                       "\\|" "sua"
                       "\\|" "suffixes"
                       "\\|" "suffixesadd"
                       "\\|" "sw"
                       "\\|" "swapfile"
                       "\\|" "swapsync"
                       "\\|" "swb"
                       "\\|" "swf"
                       "\\|" "switchbuf"
                       "\\|" "sws"
                       "\\|" "sxq"
                       "\\|" "syn"
                       "\\|" "synmaxcol"
                       "\\|" "syntax"
                       "\\|" "t_AB"
                       "\\|" "t_CS"
                       "\\|" "t_CV"
                       "\\|" "t_Co"
                       "\\|" "t_Cs"
                       "\\|" "t_DL"
                       "\\|" "t_EI"
                       "\\|" "t_F1"
                       "\\|" "t_F2"
                       "\\|" "t_F3"
                       "\\|" "t_F4"
                       "\\|" "t_F5"
                       "\\|" "t_F6"
                       "\\|" "t_F7"
                       "\\|" "t_F8"
                       "\\|" "t_F9"
                       "\\|" "t_IE"
                       "\\|" "t_IS"
                       "\\|" "t_K1"
                       "\\|" "t_K3"
                       "\\|" "t_K4"
                       "\\|" "t_K5"
                       "\\|" "t_K6"
                       "\\|" "t_K7"
                       "\\|" "t_K8"
                       "\\|" "t_K9"
                       "\\|" "t_KA"
                       "\\|" "t_KB"
                       "\\|" "t_KC"
                       "\\|" "t_KD"
                       "\\|" "t_KE"
                       "\\|" "t_KF"
                       "\\|" "t_KG"
                       "\\|" "t_KH"
                       "\\|" "t_KI"
                       "\\|" "t_KJ"
                       "\\|" "t_KK"
                       "\\|" "t_KL"
                       "\\|" "t_RI"
                       "\\|" "t_RV"
                       "\\|" "t_SI"
                       "\\|" "t_Sb"
                       "\\|" "t_Sf"
                       "\\|" "t_WP"
                       "\\|" "t_WS"
                       "\\|" "t_ZH"
                       "\\|" "t_ZR"
                       "\\|" "t_al"
                       "\\|" "t_bc"
                       "\\|" "t_ce"
                       "\\|" "t_cl"
                       "\\|" "t_cs"
                       "\\|" "t_da"
                       "\\|" "t_db"
                       "\\|" "t_dl"
                       "\\|" "t_fs"
                       "\\|" "t_k1"
                       "\\|" "t_k2"
                       "\\|" "t_k3"
                       "\\|" "t_k4"
                       "\\|" "t_k5"
                       "\\|" "t_k6"
                       "\\|" "t_k7"
                       "\\|" "t_k8"
                       "\\|" "t_k9"
                       "\\|" "t_kB"
                       "\\|" "t_kD"
                       "\\|" "t_kI"
                       "\\|" "t_kN"
                       "\\|" "t_kP"
                       "\\|" "t_kb"
                       "\\|" "t_kd"
                       "\\|" "t_ke"
                       "\\|" "t_kh"
                       "\\|" "t_kl"
                       "\\|" "t_kr"
                       "\\|" "t_ks"
                       "\\|" "t_ku"
                       "\\|" "t_le"
                       "\\|" "t_mb"
                       "\\|" "t_md"
                       "\\|" "t_me"
                       "\\|" "t_mr"
                       "\\|" "t_ms"
                       "\\|" "t_nd"
                       "\\|" "t_op"
                       "\\|" "t_se"
                       "\\|" "t_so"
                       "\\|" "t_sr"
                       "\\|" "t_te"
                       "\\|" "t_ti"
                       "\\|" "t_ts"
                       "\\|" "t_ue"
                       "\\|" "t_us"
                       "\\|" "t_ut"
                       "\\|" "t_vb"
                       "\\|" "t_ve"
                       "\\|" "t_vi"
                       "\\|" "t_vs"
                       "\\|" "t_xs"
                       "\\|" "ta"
                       "\\|" "tabline"
                       "\\|" "tabpagemax"
                       "\\|" "tabstop"
                       "\\|" "tag"
                       "\\|" "tagbsearch"
                       "\\|" "taglength"
                       "\\|" "tagrelative"
                       "\\|" "tags"
                       "\\|" "tagstack"
                       "\\|" "tal"
                       "\\|" "tb"
                       "\\|" "tbi"
                       "\\|" "tbidi"
                       "\\|" "tbis"
                       "\\|" "tbs"
                       "\\|" "tenc"
                       "\\|" "term"
                       "\\|" "termbidi"
                       "\\|" "termencoding"
                       "\\|" "terse"
                       "\\|" "textauto"
                       "\\|" "textmode"
                       "\\|" "textwidth"
                       "\\|" "tf"
                       "\\|" "tgst"
                       "\\|" "thesaurus"
                       "\\|" "tildeop"
                       "\\|" "timeout"
                       "\\|" "timeoutlen"
                       "\\|" "title"
                       "\\|" "titlelen"
                       "\\|" "titleold"
                       "\\|" "titlestring"
                       "\\|" "tl"
                       "\\|" "tm"
                       "\\|" "to"
                       "\\|" "toolbar"
                       "\\|" "toolbariconsize"
                       "\\|" "top"
                       "\\|" "tpm"
                       "\\|" "tr"
                       "\\|" "ts"
                       "\\|" "tsl"
                       "\\|" "tsr"
                       "\\|" "ttimeout"
                       "\\|" "ttimeoutlen"
                       "\\|" "ttm"
                       "\\|" "tty"
                       "\\|" "ttybuiltin"
                       "\\|" "ttyfast"
                       "\\|" "ttym"
                       "\\|" "ttymouse"
                       "\\|" "ttyscroll"
                       "\\|" "ttytype"
                       "\\|" "tw"
                       "\\|" "tx"
                       "\\|" "uc"
                       "\\|" "udf"
                       "\\|" "udir"
                       "\\|" "ul"
                       "\\|" "undodir"
                       "\\|" "undofile"
                       "\\|" "undolevels"
                       "\\|" "undoreload"
                       "\\|" "updatecount"
                       "\\|" "updatetime"
                       "\\|" "ur"
                       "\\|" "ut"
                       "\\|" "vb"
                       "\\|" "vbs"
                       "\\|" "vdir"
                       "\\|" "ve"
                       "\\|" "verbose"
                       "\\|" "verbosefile"
                       "\\|" "vfile"
                       "\\|" "vi"
                       "\\|" "viewdir"
                       "\\|" "viewoptions"
                       "\\|" "viminfo"
                       "\\|" "virtualedit"
                       "\\|" "visualbell"
                       "\\|" "vop"
                       "\\|" "wa"
                       "\\|" "wak"
                       "\\|" "warn"
                       "\\|" "wb"
                       "\\|" "wc"
                       "\\|" "wcm"
                       "\\|" "wd"
                       "\\|" "weirdinvert"
                       "\\|" "wfh"
                       "\\|" "wfw"
                       "\\|" "wh"
                       "\\|" "whichwrap"
                       "\\|" "wi"
                       "\\|" "wig"
                       "\\|" "wildchar"
                       "\\|" "wildcharm"
                       "\\|" "wildignore"
                       "\\|" "wildmenu"
                       "\\|" "wildmode"
                       "\\|" "wildoptions"
                       "\\|" "wim"
                       "\\|" "winaltkeys"
                       "\\|" "window"
                       "\\|" "winfixheight"
                       "\\|" "winfixwidth"
                       "\\|" "winheight"
                       "\\|" "winminheight"
                       "\\|" "winminwidth"
                       "\\|" "winwidth"
                       "\\|" "wiv"
                       "\\|" "wiw"
                       "\\|" "wm"
                       "\\|" "wmh"
                       "\\|" "wmnu"
                       "\\|" "wmw"
                       "\\|" "wop"
                       "\\|" "wrap"
                       "\\|" "wrapmargin"
                       "\\|" "wrapscan"
                       "\\|" "write"
                       "\\|" "writeany"
                       "\\|" "writebackup"
                       "\\|" "writedelay"
                       "\\|" "ws"
                       "\\|" "ww"
                   "\\)\\>[^_]" )
      1 font-lock-variable-name-face) ;; Variables end;


     ;; Keywords start: 
     (concat "\\(^\\|[^_]\\)\\<\\("
                          "y[ank]*"
                    "\\|" "xnoreme"
                    "\\|" "xme"
                    "\\|" "xmapc[lear]*"
                    "\\|" "xa[ll]*"
                    "\\|" "X"
                    "\\|" "x[it]*"
                    "\\|" "wv[iminfo]*"
                    "\\|" "wundo"
                    "\\|" "ws[verb]*"
                    "\\|" "wqa[ll]*"
                    "\\|" "wq"
                    "\\|" "wp[revious]*"
                    "\\|" "wN[ext]*"
                    "\\|" "wn[ext]*"
                    "\\|" "winp[os]*"
                    "\\|" "windo"
                    "\\|" "winc[md]*"
                    "\\|" "win[size]*"
                    "\\|" "wh[ile]*"
                    "\\|" "wa[ll]*"
                    "\\|" "w[rite]*"
                    "\\|" "vs[plit]*"
                    "\\|" "vne[w]*"
                    "\\|" "vmapc[lear]*"
                    "\\|" "vimgrepa[dd]*"
                    "\\|" "vim[grep]*"
                    "\\|" "vie[w]*"
                    "\\|" "vi[sual]*"
                    "\\|" "vert[ical]*"
                    "\\|" "verb[ose]*"
                    "\\|" "ve[rsion]*"
                    "\\|" "up[date]*"
                    "\\|" "uns[ilent]*"
                    "\\|" "unlo[ckvar]*"
                    "\\|" "unh[ide]*"
                    "\\|" "undol[ist]*"
                    "\\|" "undoj[oin]*"
                    "\\|" "una[bbreviate]*"
                    "\\|" "u[ndo]*"
                    "\\|" "tu"
                    "\\|" "tu[nmenu]*"
                    "\\|" "ts[elect]*"
                    "\\|" "try"
                    "\\|" "tr[ewind]*"
                    "\\|" "tp[revious]*"
                    "\\|" "to[pleft]*"
                    "\\|" "tN[ext]*"
                    "\\|" "tn[ext]*"
                    "\\|" "tm"
                    "\\|" "tm[enu]*"
                    "\\|" "tl[ast]*"
                    "\\|" "tj[ump]*"
                    "\\|" "th[row]*"
                    "\\|" "tf[irst]*"
                    "\\|" "te[aroff]*"
                    "\\|" "tclf[ile]*"
                    "\\|" "tcld[o]*"
                    "\\|" "tc[l]*"
                    "\\|" "tags"
                    "\\|" "tabs"
                    "\\|" "tabr[ewind]*"
                    "\\|" "tabp[revious]*"
                    "\\|" "tabo[nly]*"
                    "\\|" "tabnew"
                    "\\|" "tabN[ext]*"
                    "\\|" "tabn[ext]*"
                    "\\|" "tabm[ove]*"
                    "\\|" "tabl[ast]*"
                    "\\|" "tabfir[st]*"
                    "\\|" "tabf[ind]*"
                    "\\|" "tabe[dit]*"
                    "\\|" "tabd[o]*"
                    "\\|" "tabc[lose]*"
                    "\\|" "tab"
                    "\\|" "ta[g]*"
                    "\\|" "t"
                    "\\|" "syncbind"
                    "\\|" "sv[iew]*"
                    "\\|" "sus[pend]*"
                    "\\|" "sunmenu"
                    "\\|" "sunme"
                    "\\|" "sun[hide]*"
                    "\\|" "sts[elect]*"
                    "\\|" "stopi[nsert]*"
                    "\\|" "stj[ump]*"
                    "\\|" "startr[eplace]*"
                    "\\|" "startg[replace]*"
                    "\\|" "star[tinsert]*"
                    "\\|" "sta[g]*"
                    "\\|" "st[op]*"
                    "\\|" "sre[wind]*"
                    "\\|" "spr[evious]*"
                    "\\|" "spellw[rong]*"
                    "\\|" "spellu[ndo]*"
                    "\\|" "spellr[epall]*"
                    "\\|" "spelli[nfo]*"
                    "\\|" "spelld[ump]*"
                    "\\|" "spe[llgood]*"
                    "\\|" "sp[lit]*"
                    "\\|" "sor[t]*"
                    "\\|" "so[urce]*"
                    "\\|" "snoremenu"
                    "\\|" "snoreme"
                    "\\|" "sno[magic]*"
                    "\\|" "sni[ff]*"
                    "\\|" "sN[ext]*"
                    "\\|" "sn[ext]*"
                    "\\|" "smenu"
                    "\\|" "sme"
                    "\\|" "sm[ap]*"
                    "\\|" "sm[agic]*"
                    "\\|" "sla[st]*"
                    "\\|" "sl[eep]*"
                    "\\|" "sim[alt]*"
                    "\\|" "sil[ent]*"
                    "\\|" "sign"
                    "\\|" "sh[ell]*"
                    "\\|" "sfir[st]*"
                    "\\|" "sf[ind]*"
                    "\\|" "setl[ocal]*"
                    "\\|" "setg[lobal]*"
                    "\\|" "setf[iletype]*"
                    "\\|" "se[t]*"
                    "\\|" "scripte[ncoding]*"
                    "\\|" "scrip[tnames]*"
                    "\\|" "sbr[ewind]*"
                    "\\|" "sbp[revious]*"
                    "\\|" "sbN[ext]*"
                    "\\|" "sbn[ext]*"
                    "\\|" "sbm[odified]*"
                    "\\|" "sbl[ast]*"
                    "\\|" "sbf[irst]*"
                    "\\|" "sba[ll]*"
                    "\\|" "sb[uffer]*"
                    "\\|" "sav[eas]*"
                    "\\|" "san[dbox]*"
                    "\\|" "sal[l]*"
                    "\\|" "sa[rgument]*"
                    "\\|" "rv[iminfo]*"
                    "\\|" "rundo"
                    "\\|" "rubyf[ile]*"
                    "\\|" "rubyd[o]*"
                    "\\|" "rub[y]*"
                    "\\|" "ru[ntime]*"
                    "\\|" "rightb[elow]*"
                    "\\|" "ri[ght]*"
                    "\\|" "rew[ind]*"
                    "\\|" "retu[rn]*"
                    "\\|" "ret[ab]*"
                    "\\|" "res[ize]*"
                    "\\|" "reg[isters]*"
                    "\\|" "redraws[tatus]*"
                    "\\|" "redr[aw]*"
                    "\\|" "redi[r]*"
                    "\\|" "red[o]*"
                    "\\|" "rec[over]*"
                    "\\|" "r[ead]*"
                    "\\|" "quita[ll]*"
                    "\\|" "qa[ll]*"
                    "\\|" "q[uit]*"
                    "\\|" "pyf[ile]*"
                    "\\|" "py[thon]*"
                    "\\|" "pw[d]*"
                    "\\|" "pu[t]*"
                    "\\|" "pts[elect]*"
                    "\\|" "ptr[ewind]*"
                    "\\|" "ptp[revious]*"
                    "\\|" "ptN[ext]*"
                    "\\|" "ptn[ext]*"
                    "\\|" "ptl[ast]*"
                    "\\|" "ptj[ump]*"
                    "\\|" "ptf[irst]*"
                    "\\|" "pta[g]*"
                    "\\|" "ps[earch]*"
                    "\\|" "promptr[epl]*"
                    "\\|" "promptf[ind]*"
                    "\\|" "profd[el]*"
                    "\\|" "prof[ile]*"
                    "\\|" "prev[ious]*"
                    "\\|" "pre[serve]*"
                    "\\|" "pp[op]*"
                    "\\|" "popu"
                    "\\|" "popu[p]*"
                    "\\|" "po[p]*"
                    "\\|" "perld[o]*"
                    "\\|" "ped[it]*"
                    "\\|" "pe[rl]*"
                    "\\|" "pc[lose]*"
                    "\\|" "P[rint]*"
                    "\\|" "p[rint]*"
                    "\\|" "opt[ions]*"
                    "\\|" "on[ly]*"
                    "\\|" "omapc[lear]*"
                    "\\|" "ol[dfiles]*"
                    "\\|" "o[pen]*"
                    "\\|" "nu[mber]*"
                    "\\|" "noh[lsearch]*"
                    "\\|" "nmapc[lear]*"
                    "\\|" "new"
                    "\\|" "nbs[tart]*"
                    "\\|" "nbc[lose]*"
                    "\\|" "nb[key]*"
                    "\\|" "N[ext]*"
                    "\\|" "n[ext]*"
                    "\\|" "mzf[ile]*"
                    "\\|" "mz[scheme]*"
                    "\\|" "mod[e]*"
                    "\\|" "mkvie[w]*"
                    "\\|" "mkv[imrc]*"
                    "\\|" "mksp[ell]*"
                    "\\|" "mks[ession]*"
                    "\\|" "mk[exrc]*"
                    "\\|" "menut[ranslate]*"
                    "\\|" "mat[ch]*"
                    "\\|" "marks"
                    "\\|" "mak[e]*"
                    "\\|" "ma[rk]*"
                    "\\|" "m[ove]*"
                    "\\|" "lw[indow]*"
                    "\\|" "lvimgrepa[dd]*"
                    "\\|" "lv[imgrep]*"
                    "\\|" "luafile"
                    "\\|" "luado"
                    "\\|" "lua"
                    "\\|" "lt[ag]*"
                    "\\|" "ls"
                    "\\|" "lr[ewind]*"
                    "\\|" "lpf[ile]*"
                    "\\|" "lp[revious]*"
                    "\\|" "lop[en]*"
                    "\\|" "lol[der]*"
                    "\\|" "lockv[ar]*"
                    "\\|" "loc[kmarks]*"
                    "\\|" "lo[adview]*"
                    "\\|" "lNf[ile]*"
                    "\\|" "lnf[ile]*"
                    "\\|" "lnew[er]*"
                    "\\|" "lne[xt]*"
                    "\\|" "lN[ext]*"
                    "\\|" "lmapc[lear]*"
                    "\\|" "lmak[e]*"
                    "\\|" "lli[st]*"
                    "\\|" "lla[st]*"
                    "\\|" "ll"
                    "\\|" "lgrepa[dd]*"
                    "\\|" "lgr[ep]*"
                    "\\|" "lgete[xpr]*"
                    "\\|" "lgetb[uffer]*"
                    "\\|" "lg[etfile]*"
                    "\\|" "lfir[st]*"
                    "\\|" "lf[ile]*"
                    "\\|" "lex[pr]*"
                    "\\|" "lefta[bove]*"
                    "\\|" "le[ft]*"
                    "\\|" "lcl[ose]*"
                    "\\|" "lch[dir]*"
                    "\\|" "lc[d]*"
                    "\\|" "lb[uffer]*"
                    "\\|" "later"
                    "\\|" "lan[guage]*"
                    "\\|" "laddf[ile]*"
                    "\\|" "laddb[uffer]*"
                    "\\|" "lad[dexpr]*"
                    "\\|" "la[st]*"
                    "\\|" "l[ist]*"
                    "\\|" "keepj[umps]*"
                    "\\|" "keepalt"
                    "\\|" "kee[pmarks]*"
                    "\\|" "k"
                    "\\|" "ju[mps]*"
                    "\\|" "j[oin]*"
                    "\\|" "iuna[bbrev]*"
                    "\\|" "isp[lit]*"
                    "\\|" "is[earch]*"
                    "\\|" "imapc[lear]*"
                    "\\|" "il[ist]*"
                    "\\|" "ij[ump]*"
                    "\\|" "if"
                    "\\|" "iabc[lear]*"
                    "\\|" "his[tory]*"
                    "\\|" "hid[e]*"
                    "\\|" "ha[rdcopy]*"
                    "\\|" "grepa[dd]*"
                    "\\|" "gr[ep]*"
                    "\\|" "go[to]*"
                    "\\|" "fu[nction]*"
                    "\\|" "for"
                    "\\|" "foldo[pen]*"
                    "\\|" "folddoc[losed]*"
                    "\\|" "foldd[oopen]*"
                    "\\|" "foldc[lose]*"
                    "\\|" "fo[ld]*"
                    "\\|" "fix[del]*"
                    "\\|" "fir[st]*"
                    "\\|" "fini[sh]*"
                    "\\|" "fina[lly]*"
                    "\\|" "fin[d]*"
                    "\\|" "filetype"
                    "\\|" "files"
                    "\\|" "f[ile]*"
                    "\\|" "exi[t]*"
                    "\\|" "exe[cute]*"
                    "\\|" "ex"
                    "\\|" "ene[w]*"
                    "\\|" "endw[hile]*"
                    "\\|" "endt[ry]*"
                    "\\|" "endfo[r]*"
                    "\\|" "endf[unction]*"
                    "\\|" "en[dif]*" 
                    "\\|" "emenu*"
                    "\\|" "em[enu]*"
                    "\\|" "elsei[f]*"
                    "\\|" "el[se]*"
                    "\\|" "echon"
                    "\\|" "echom[sg]*"
                    "\\|" "echoe[rr]*"
                    "\\|" "earlier"
                    "\\|" "e[dit]*"
                    "\\|" "dsp[lit]*"
                    "\\|" "ds[earch]*"
                    "\\|" "dr[op]*"
                    "\\|" "dl[ist]*"
                    "\\|" "dj[ump]*"
                    "\\|" "dig[raphs]*"
                    "\\|" "diffu[pdate]*"
                    "\\|" "diffthis"
                    "\\|" "diffsplit"
                    "\\|" "diffpu[t]*"
                    "\\|" "diffpatch"
                    "\\|" "diffoff"
                    "\\|" "diffg[et]*"
                    "\\|" "di[splay]*"
                    "\\|" "delm[arks]*"
                    "\\|" "delf[unction]*"
                    "\\|" "delc[ommand]*"
                    "\\|" "debugg[reedy]*"
                    "\\|" "d[elete]*"
                    "\\|" "cw[indow]*"
                    "\\|" "cuna[bbrev]*"
                    "\\|" "cr[ewind]*"
                    "\\|" "cq[uit]*"
                    "\\|" "cpf[ile]*"
                    "\\|" "cp[revious]*"
                    "\\|" "cope[n]*"
                    "\\|" "conf[irm]*"
                    "\\|" "con[tinue]*"
                    "\\|" "comp[iler]*"
                    "\\|" "comc[lear]*"
                    "\\|" "colo[rscheme]*"
                    "\\|" "col[der]*"
                    "\\|" "co[py]*"
                    "\\|" "cNf[ile]*"
                    "\\|" "cnf[ile]*"
                    "\\|" "cnew[er]*"
                    "\\|" "cN[ext]*"
                    "\\|" "cn[ext]*"
                    "\\|" "cmapc[lear]*"
                    "\\|" "clo[se]*"
                    "\\|" "cla[st]*"
                    "\\|" "cl[ist]*"
                    "\\|" "checkt[ime]*"
                    "\\|" "che[ckpath]*"
                    "\\|" "chd[ir]*"
                    "\\|" "changes"
                    "\\|" "cgete[xpr]*"
                    "\\|" "cgetb[uffer]*"
                    "\\|" "cg[etfile]*"
                    "\\|" "cfir[st]*"
                    "\\|" "cf[ile]*"
                    "\\|" "cex[pr]*"
                    "\\|" "ce[nter]*"
                    "\\|" "cd"
                    "\\|" "ccl[ose]*"
                    "\\|" "cc"
                    "\\|" "cb[uffer]*"
                    "\\|" "cat[ch]*"
                    "\\|" "cal[l]*"
                    "\\|" "caddf[ile]*"
                    "\\|" "caddb[uffer]*"
                    "\\|" "cad[dexpr]*"
                    "\\|" "cabc[lear]*"
                    "\\|" "c[hange]*"
                    "\\|" "bw[ipeout]*"
                    "\\|" "bun[load]*"
                    "\\|" "buffers"
                    "\\|" "bufdo"
                    "\\|" "bro[wse]*"
                    "\\|" "breakl[ist]*"
                    "\\|" "breakd[el]*"
                    "\\|" "breaka[dd]*"
                    "\\|" "brea[k]*"
                    "\\|" "br[ewind]*"
                    "\\|" "bp[revious]*"
                    "\\|" "bo[tright]*"
                    "\\|" "bN[ext]*"
                    "\\|" "bn[ext]*"
                    "\\|" "bm[odified]*"
                    "\\|" "bl[ast]*"
                    "\\|" "bf[irst]*"
                    "\\|" "bel[owright]*"
                    "\\|" "bd[elete]*"
                    "\\|" "bad[d]*"
                    "\\|" "ba[ll]*"
                    "\\|" "b[uffer]*"
                    "\\|" "aug[roup]*"
                    "\\|" "au[tocmd]*"
                    "\\|" "as[cii]*"
                    "\\|" "argu[ment]*"
                    "\\|" "argl[ocal]*"
                    "\\|" "argg[lobal]*"
                    "\\|" "arge[dit]*"
                    "\\|" "argdo"
                    "\\|" "argd[elete]*"
                    "\\|" "arga[dd]*"
                    "\\|" "ar[gs]*"
                    "\\|" "al[l]*"
                    "\\|" "abo[veleft]*"
                    "\\|" "abc[lear]*"
             "\\)\\>\\([^_]\\|$\\)"
      ) ;; Keywords end; 

     ;; Builtins start:
     (list
      (concat "\\(^\\|[^_]\\)\\<\\("
                              "writefile"
                        "\\|" "winwidth"
                        "\\|" "winsaveview"
                        "\\|" "winrestview"
                        "\\|" "winrestcmd"
                        "\\|" "winnr"
                        "\\|" "winline"
                        "\\|" "winheight"
                        "\\|" "wincol"
                        "\\|" "winbufnr"
                        "\\|" "visualmode"
                        "\\|" "virtcol"
                        "\\|" "values"
                        "\\|" "undotree"
                        "\\|" "undofile"
                        "\\|" "type"
                        "\\|" "trunc"
                        "\\|" "tr"
                        "\\|" "toupper"
                        "\\|" "tolower"
                        "\\|" "tempname"
                        "\\|" "tanh"
                        "\\|" "tan"
                        "\\|" "taglist"
                        "\\|" "tagfiles"
                        "\\|" "tabpagewinnr"
                        "\\|" "tabpagenr"
                        "\\|" "tabpagebuflist"
                        "\\|" "system"
                        "\\|" "synstack"
                        "\\|" "synIDtrans"
                        "\\|" "synIDattr"
                        "\\|" "synID"
                        "\\|" "synconcealed"
                        "\\|" "substitute"
                        "\\|" "submatch"
                        "\\|" "strwidth"
                        "\\|" "strtrans"
                        "\\|" "strridx"
                        "\\|" "strpart"
                        "\\|" "strlen"
                        "\\|" "string"
                        "\\|" "stridx"
                        "\\|" "strftime"
                        "\\|" "strdisplaywidth"
                        "\\|" "strchars"
                        "\\|" "str2nr"
                        "\\|" "str2float"
                        "\\|" "sqrt"
                        "\\|" "split"
                        "\\|" "spellsuggest"
                        "\\|" "spellbadword"
                        "\\|" "soundfold"
                        "\\|" "sort"
                        "\\|" "sinh"
                        "\\|" "sin"
                        "\\|" "simplify"
                        "\\|" "shellescape"
                        "\\|" "setwinvar"
                        "\\|" "settabwinvar"
                        "\\|" "settabvar"
                        "\\|" "setreg"
                        "\\|" "setqflist"
                        "\\|" "setpos"
                        "\\|" "setmatches"
                        "\\|" "setloclist"
                        "\\|" "setline"
                        "\\|" "setcmdpos"
                        "\\|" "setbufvar"
                        "\\|" "serverlist"
                        "\\|" "server2client"
                        "\\|" "searchpos"
                        "\\|" "searchpairpos"
                        "\\|" "searchpair"
                        "\\|" "searchdecl"
                        "\\|" "search"
                        "\\|" "round"
                        "\\|" "reverse"
                        "\\|" "resolve"
                        "\\|" "repeat"
                        "\\|" "rename"
                        "\\|" "remove"
                        "\\|" "remote_send"
                        "\\|" "remote_read"
                        "\\|" "remote_peek"
                        "\\|" "remote_foreground"
                        "\\|" "remote_expr"
                        "\\|" "reltimestr"
                        "\\|" "reltime"
                        "\\|" "readfile"
                        "\\|" "range"
                        "\\|" "pumvisible"
                        "\\|" "printf"
                        "\\|" "prevnonblank"
                        "\\|" "pow"
                        "\\|" "pathshorten"
                        "\\|" "nr2char"
                        "\\|" "nextnonblank"
                        "\\|" "mzeval"
                        "\\|" "mode"
                        "\\|" "mkdir"
                        "\\|" "min"
                        "\\|" "max"
                        "\\|" "matchstr"
                        "\\|" "matchlist" 
                        "\\|" "matchend"
                        "\\|" "matchdelete"
                        "\\|" "matcharg"
                        "\\|" "matchadd"
                        "\\|" "match"
                        "\\|" "mapcheck"
                        "\\|" "maparg"
                        "\\|" "map"
                        "\\|" "log10"
                        "\\|" "log"
                        "\\|" "localtime"
                        "\\|" "lispindent"
                        "\\|" "line2byte"
                        "\\|" "line"
                        "\\|" "libcallnr"
                        "\\|" "libcall"
                        "\\|" "len"
                        "\\|" "keys"
                        "\\|" "join"
                        "\\|" "items"
                        "\\|" "islocked"
                        "\\|" "isdirectory"
                        "\\|" "insert"
                        "\\|" "inputsecret"
                        "\\|" "inputsave"
                        "\\|" "inputrestore"
                        "\\|" "inputlist"
                        "\\|" "inputdialog"
                        "\\|" "input"
                        "\\|" "index"
                        "\\|" "indent"
                        "\\|" "iconv"
                        "\\|" "hostname"
                        "\\|" "hlID"
                        "\\|" "hlexists"
                        "\\|" "histnr"
                        "\\|" "histget"
                        "\\|" "histdel"
                        "\\|" "histadd"
                        "\\|" "hasmapto"
                        "\\|" "haslocaldir"
                        "\\|" "has_key"
                        "\\|" "has"
                        "\\|" "globpath"
                        "\\|" "glob"
                        "\\|" "getwinvar"
                        "\\|" "getwinposy"
                        "\\|" "getwinposx"
                        "\\|" "gettabwinvar"
                        "\\|" "gettabvar"
                        "\\|" "getregtype"
                        "\\|" "getreg"
                        "\\|" "getqflist"
                        "\\|" "getpos"
                        "\\|" "getpid"
                        "\\|" "getmatches"
                        "\\|" "getloclist"
                        "\\|" "getline"
                        "\\|" "getftype"
                        "\\|" "getftime"
                        "\\|" "getfsize"
                        "\\|" "getfperm"
                        "\\|" "getfontname"
                        "\\|" "getcwd"
                        "\\|" "getcmdtype"
                        "\\|" "getcmdpos"
                        "\\|" "getcmdline"
                        "\\|" "getcharmod"
                        "\\|" "getchar"
                        "\\|" "getbufvar"
                        "\\|" "getbufline"
                        "\\|" "get"
                        "\\|" "garbagecollect"
                        "\\|" "function"
                        "\\|" "foreground"
                        "\\|" "foldtextresult"
                        "\\|" "foldtext"
                        "\\|" "foldlevel"
                        "\\|" "foldclosedend"
                        "\\|" "foldclosed"
                        "\\|" "fnamemodify"
                        "\\|" "fnameescape"
                        "\\|" "fmod"
                        "\\|" "floor"
                        "\\|" "float2nr"
                        "\\|" "findfile"
                        "\\|" "finddir"
                        "\\|" "filter"
                        "\\|" "filewritable"
                        "\\|" "filereadable"
                        "\\|" "feedkeys"
                        "\\|" "extend"
                        "\\|" "expr8"
                        "\\|" "expand"
                        "\\|" "exp"
                        "\\|" "exists"
                        "\\|" "eventhandler"
                        "\\|" "eval"
                        "\\|" "escape"
                        "\\|" "empty"
                        "\\|" "diff_hlID"
                        "\\|" "diff_filler"
                        "\\|" "did_filetype"
                        "\\|" "delete"
                        "\\|" "deepcopy"
                        "\\|" "cursor"
                        "\\|" "cscope_connection"
                        "\\|" "count"
                        "\\|" "cosh"
                        "\\|" "cos"
                        "\\|" "copy"
                        "\\|" "contained"
                        "\\|" "confirm"
                        "\\|" "complete_check"
                        "\\|" "complete_add"
                        "\\|" "complete"
                        "\\|" "col"
                        "\\|" "clearmatches"
                        "\\|" "cindent"
                        "\\|" "char2nr"
                        "\\|" "changenr"
                        "\\|" "ceil"
                        "\\|" "call"
                        "\\|" "byteidx"
                        "\\|" "byte2line"
                        "\\|" "bufwinnr"
                        "\\|" "bufnr"
                        "\\|" "bufname"
                        "\\|" "bufloaded"
                        "\\|" "buflisted"
                        "\\|" "bufexists"
                        "\\|" "browsedir"
                        "\\|" "browse"
                        "\\|" "atan2"
                        "\\|" "atan"
                        "\\|" "asin"
                        "\\|" "argv"
                        "\\|" "argidx"
                        "\\|" "argc"
                        "\\|" "append"
                        "\\|" "add"
                        "\\|" "acos"
                        "\\|" "abs"
             "\\)\\>\\([^_]\\|$\\)")
      1 font-lock-builtin-face) ;; Builtins end;

     ;;
     ;; Operators start:
     (list (concat "\\("
                       ;; word char
                             "\\(\\<isnot\\>\\)"
                       "\\|" "\\(\\<is\\>\\)"

                       "\\|" "\\(![=~]?[#?]?\\)"
                       "\\|" "\\(>[#\\\\?=]?[#?]?\\)"
                       "\\|" "\\(<[#\\\\?=]?[#?]?\\)" 
                       "\\|" "\\(\\+=?\\)"
                       "\\|" "\\(-=?\\)"
                       "\\|" "\\(=[=~]?[#?]?\\)"
                       "\\|" "\\(||\\)"
                       "\\|" "\\(&&\\)"

                       "\\|" "\\(\\.\\)"
                   "\\)"
                   )
	   1 font-lock-constant-face) ;; Operators end;
     ))
 "Default expressions to highlight in Vimrc mode.")

;;;###autoload
(define-derived-mode vimrc-mode fundamental-mode "Vimrc"
  "Major mode for editing `vimrc', `xxx.vim' and `.exrc' configuration files."
  (setq font-lock-defaults '(vimrc-font-lock-keywords))
  (set (make-local-variable 'comment-start) "\"")
  (set (make-local-variable 'comment-end) "")
  (modify-syntax-entry ?\" ".")
  ;(set (make-local-variable 'comment-start-skip) "\"\\* +")
  (run-hooks 'vimrc-mode-hook))

(provide 'vimrc-mode)

;;; vimrc-mode.el ends here
